package hasthi.common;

import hasthi.container.MessageProcessor;
import hasthi.container.SoapContainer;
import hasthi.container.UnicastContianier;
import hasthi.container.XsulBasedSoapContainer;
import hasthi.container.p2p.MulticastContianier;
import hasthi.container.p2p.P2PContainer;

public class ComponetFactory {
    
    public static UnicastContianier createSoapContianier(BaseContext baseContext,MessageProcessor processor) throws HasthiException{
        //return new SoapContainer(baseContext,processor);
        //return new NonBlockingSoapContainer(baseContext,processor);
        return new XsulBasedSoapContainer(baseContext,processor);
    }
    
    public static UnicastContianier createSoapContianier(BaseContext baseContext,MessageProcessor processor,int port,boolean secure) throws HasthiException{
//        SoapContainer soapContainer = new SoapContainer(baseContext,processor,port);
//        soapContainer.setSecure(secure);
//        return soapContainer;
        XsulBasedSoapContainer container = new XsulBasedSoapContainer(baseContext,processor,port);
        if(secure){
            container.setSecure(true);
        }
        return container;
    }
    
    public static MulticastContianier createMulticastContianier(BaseContext baseContext,MessageProcessor processor) throws HasthiException{
        return new P2PContainer(baseContext,processor);
    }
}
